﻿                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AutoCode.Win
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 目录选择操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btndir_Click(object sender, EventArgs e)
        {
            if (this.folderBrowserDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.tbdir.Text = this.folderBrowserDialog1.SelectedPath;
                Config.Dir = this.tbdir.Text;
            }
        }

        private void btnAutoCode_Click(object sender, EventArgs e)
        {
            Config.NameSpace = this.tbnamespace.Text;
            CodeAuto ca = new CodeAuto();
            if(cbModel.Checked)
                ca.CreateModelCode("",cbFuGai.Checked,Config.NameSpace);
            if(cbDal.Checked)
                ca.CreateDalCode(cbFuGai.Checked, Config.NameSpace);
            MessageBox.Show("ok!");
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.tbdir.Text = Config.Dir;
            this.tbnamespace.Text = Config.NameSpace;
        }



      
    }
}
